/*
    36. Write a program in C to display the such a pattern for n number of rows using a number
    which will start with the number 1 and the first and a last number of each row will be 1. 
      1
     121
    12321
*/
#include <stdio.h>

int main(void){
    int rows;
    printf("Input number of rows: ");
    scanf("%d", &rows);
    for(int i = 0; i < rows; i++){
        for(int j = rows - i - 1; j > 0; j--){
            printf(" ");
        }
        for(int j = 0; j <= i; j++){
            printf("%d", j + 1);
        }
        for(int j = i; j > 0; j--){
            printf("%d", j);
        }
        printf("\n");
    }
    return 0;
}